<template>
  <el-card class="documentRank-container"
           shadow="never">
    <div slot="header">
      相关文档推荐
    </div>
    <div class="documentRank-ranking">
      <ul>
        <li v-for="(i, index) in documentRankList"
            :key="i.id">
          <span class="rankNum">{{ index + 1 }}</span>
          <el-link class="title"
                   @click="GodocumentRankDetail(i)">{{ i.document_title }}</el-link>
        </li>
      </ul>
    </div>
  </el-card>
</template>

<script>
export default {
  props: {

  },
  components: {

  },
  data () {
    return {
      // 限制和页数
      limit: 3,
      page: 1,
      // 公告列表
      documentRankList: []
    };
  },
  computed: {

  },
  watch: {

  },
  created () {

  },
  mounted () {
    // 获取推荐文档列表
    this.$nextTick(() => {
      this.getdocumentRankList()
    })
  },
  methods: {
    // 获取推荐文档列表
    async getdocumentRankList () {
      const { limit, page } = this
      const res = await this.$API.document.getRankDownloadList(limit, page)
      if (res.status == 200) {
        this.documentRankList = res.data
      }
    }
  },
};
</script>

<style scoped>
.documentRank-container {
  margin: 20px 0;
  /* border-radius: 16px; */
}
.documentRank-ranking {
  width: 100%;
  /* margin-top: 20px; */
}

.documentRank-ranking ul {
  list-style: none;
  padding: 0;
}

.documentRank-ranking li {
  display: flex;
  /* justify-content: space-between; */
  /* align-items: center; */
  margin-bottom: 15px;
  font-size: 14px;
}
.rankNum {
  color: #9090ab;
}
.documentRank-ranking .title {
  margin-left: 10px;
}
</style>
